package com.zhl.study.Entity;

import com.zhl.study.annotation.ArrayVal;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @description 实体类
 * @Author: z156940l@outlook.com
 * @className Shop
 * @Date: 2023/4/28 10:33
 */
@Data
@ApiModel(value = "Shop", description = "shop参数")
public class Shop implements Serializable {

    private static final long serialVersionUID = 1743380021470168576L;
    @NotNull(message = "id不能为空")
    private Integer id;

    @NotBlank(message = "商品名称不能为空")
    private String name;

    private Integer type;

    @Pattern(regexp = "^[0-9a-zA-z].*", message = "检索首字母必须是一个字母")
    private String fitter;

    @Min(value = 0, message = "排序必须大于等于0")
    private Integer sort;

    @ArrayVal(value = {1,0}, message = "字段必须为1或者0")
    private int status;
}
